using System;
using System.IO;
using UnityEngine;

namespace PKGames.AssetBundleSystem
{
	public class AssetBundleSetupResolverDevelopment : AssetBundleSetupResolverInterface
	{
		[Serializable]
		public class DevelopmentAssetBundleSetupConfiguration
		{
			[SerializeField]
			private string host;

			[SerializeField]
			private string version;

			public string Host => host;

			public string Version => version;
		}

		private string _version = string.Empty;

		private string _host = string.Empty;

		//public AssetBundleSetupResolverDevelopment()
		//{
		//	string text = Path.Combine(Application.streamingAssetsPath, "AssetBundleSetupConfiguration.json");
		//	string json = null;
		//	if (text.StartsWith("jar", StringComparison.CurrentCulture))
		//	{
		//		using (WWW wWW = new WWW(text))
		//		{
		//			while (wWW.MoveNext())
		//			{
		//			}
		//			if (wWW.error == null)
		//			{
		//				json = wWW.text;
		//			}
		//		}
		//	}
		//	else
		//	{
		//		json = File.ReadAllText(text);
		//	}
		//	DevelopmentAssetBundleSetupConfiguration developmentAssetBundleSetupConfiguration = JsonUtility.FromJson<DevelopmentAssetBundleSetupConfiguration>(json);
		//	_host = developmentAssetBundleSetupConfiguration.Host;
		//	_version = developmentAssetBundleSetupConfiguration.Version;
		//}

		public string GetAssetBundleHost()
		{
			return _host;
		}

		public string GetAssetBundleVersion()
		{
			return _version;
		}
	}
}
